//
// Created by iguilty on 2022-01-14.
//

#include "Memento.h"
#include <iostream>

using namespace std;

int main(){
    Originator* o = new Originator();
    o->SetState("old");
    o->PrintState();
    Memento* m = o->CreateMemento();
    o->SetState("new");
    o->PrintState();
    o->RestoreToMemento(m);
    o->PrintState();
    return 0;
}